package no.mehdi.usereg.rfid.listeners;

import no.mehdi.usereg.rfid.events.AttachEventApp;

import org.springframework.context.ApplicationListener;

import com.phidgets.RFIDPhidget;
import com.phidgets.event.AttachEvent;
import com.phidgets.event.AttachListener;


public class AttachListenerApp implements AttachListener,ApplicationListener<AttachEventApp>{
	AttachEvent attachEvent;
	
	@Override
	public void attached(AttachEvent attachEvent) {
		this.attachEvent = attachEvent;
		
		onApplicationEvent(new AttachEventApp(attachEvent.getSource()));
	}

	@Override
	public void onApplicationEvent(AttachEventApp arg0) {
		System.out.println("Fired a "+ arg0);
	}
	public RFIDPhidget getSource(){
		return (RFIDPhidget) attachEvent.getSource();
	}
	
	

}
